package com.rakuten.api.mule.transformers;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

import org.codehaus.jackson.map.ObjectMapper;
import org.mule.api.transformer.TransformerException;
import org.mule.config.i18n.MessageFactory;
import org.mule.transformer.AbstractMessageTransformer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.mule.transformer.types.DataTypeFactory;
import org.mule.api.MuleMessage;

public class BulkApiToResponse extends AbstractMessageTransformer{

    public BulkApiToResponse() {
	registerSourceType(DataTypeFactory.STRING);
	setReturnDataType(DataTypeFactory.STRING);
    }

    public Object transformMessage(MuleMessage message, String outputEncoding) 
    		throws TransformerException {
		Map map = new HashMap();
		
		String payload = null;


    	try {
    		payload = message.getPayloadAsString();
    		logger.info(payload);
    		//String requestData =  (String)(message.getInvocationProperty("request-data"));



    	} catch (Exception e) {                  
    		throw new TransformerException(this, e);
    	}
    	
    	return payload;
    }
} 
